home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / elm / elm2.4 / Makefile.SH < prev    next >
Encoding:
Makefile  |  1993-04-20  |  3.5 KB  |  134 lines

  1. case $CONFIG in
  2. '')
  3.     if test ! -f config.sh; then
  4.     ln ../config.sh . || \
  5.     ln ../../config.sh . || \
  6.     ln ../../../config.sh . || \
  7.     (echo "Can't find config.sh."; exit 1)
  8.     fi
  9.     . ./config.sh
  10.     ;;
  11. esac
  12. case "$0" in
  13. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  14. esac
  15.  
  16. case "$d_symlink" in
  17. *define*) sln='ln -s' ;;
  18. *) sln='ln';;
  19. esac
  20.  
  21. echo "Extracting Makefile (with variable substitutions)"
  22. cat >Makefile <<!GROK!THIS!
  23. #
  24. # $Id: Makefile.SH,v 5.3 1993/04/21 01:53:10 syd Exp $
  25. #
  26. #  Makefile for the entire ELM mail system
  27. #
  28. #         (C) Copyright 1986,1987, by Dave Taylor
  29. #         (C) Copyright 1988-1992, USENET Community Trust
  30. #
  31. #  $Log: Makefile.SH,v $
  32. # Revision 5.3  1993/04/21  01:53:10  syd
  33. # take out parallelism, effects standard make
  34. #
  35. # Revision 5.2  1993/04/21  01:26:18  syd
  36. # Support parallel makes in subdirectories with e.g. "make J=2".
  37. # From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  38. #
  39. # Revision 5.1  1992/10/03  22:12:17  syd
  40. # Initial checkin as of 2.4 Release at PL0
  41. #
  42. #
  43.  
  44. #    Variables established by Configure
  45. CAT        =    $cat
  46. GREP        =    $grep
  47. ECHO        =    $echo
  48. MAKE        =    $make
  49. PR        =    $pr
  50. SHAR        =    $shar -s 60000
  51. SLEEP        =    $sleep
  52. TAR        =    $tar
  53. TAPE        =    $rmttape
  54.  
  55. !GROK!THIS!
  56. cat >>Makefile <<'!NO!SUBS!'
  57. #    Other variables
  58. SHELL            =    /bin/sh
  59. SOURCE_FILES        =    `$(GREP) -v 'doc/' MANIFEST`
  60. DISTRIBUTED_FILES    =    `$(CAT) MANIFEST`
  61.  
  62. # Targets
  63. #    Give default target first and alone
  64. default_target:    all
  65.  
  66. #    Targets that are simply executed in each subordinate makefile as is
  67. all install uninstall lint clean:
  68.         cd lib; $(MAKE) $(MJ) -$(MAKEFLAGS) $@
  69.         cd src; $(MAKE) $(MJ) -$(MAKEFLAGS) $@
  70.         cd utils; $(MAKE) $(MJ) -$(MAKEFLAGS) $@
  71.         cd filter; $(MAKE) $(MJ) -$(MAKEFLAGS) $@
  72.         cd doc; $(MAKE) $(MJ) -$(MAKEFLAGS) $@
  73.  
  74. #    Targets that apply to all elm at once
  75. listing:
  76.         @$(ECHO) "Making source listing in file LISTING."
  77.         @$(PR) -n -f $(SOURCE_FILES) > LISTING
  78.  
  79. #    This is the only target that gets installed even if not out-of-date
  80. #    with respect the files from which it is installed.
  81. rmt-install:    rmt-defined
  82.         @($(ECHO) "Warning: This assumes you have already installed";\
  83.           $(ECHO) "ELM on the remote machine <$(REMOTE)>. If this is";\
  84.           $(ECHO) "not the case, interrupt this process quickly!";\
  85.           $(SLEEP) 10;)
  86.         cd lib; $(MAKE) $(MJ) -$(MAKEFLAGS) REMOTE=$(REMOTE) $@
  87.         cd src; $(MAKE) $(MJ) -$(MAKEFLAGS) REMOTE=$(REMOTE) $@
  88.         cd filter; $(MAKE) $(MJ) -$(MAKEFLAGS) REMOTE=$(REMOTE) $@
  89.         cd utils; $(MAKE) $(MJ) -$(MAKEFLAGS) REMOTE=$(REMOTE) $@
  90.         cd doc; $(MAKE) $(MJ) -$(MAKEFLAGS) REMOTE=$(REMOTE) $@
  91.  
  92. rmt-defined:
  93.     @(if [ "$(REMOTE)" = "" ];\
  94.       then\
  95.         $(ECHO) "You need to define 'REMOTE' as the remote file system";\
  96.         $(ECHO) "for this particular command. The easiest way to do this";\
  97.         $(ECHO) "to type:";\
  98.         $(ECHO) "        make REMOTE=<remote file system> rmt-install";\
  99.         exit 1;\
  100.     fi);
  101.  
  102. shar:
  103.         $(SHAR) $(DISTRIBUTED_FILES)
  104.  
  105. tar:
  106.         $(TAR) cvf $(TAPE) $(DISTRIBUTED_FILES)
  107.  
  108. #    Targets that are really in subordinate make files
  109. documentation:
  110.     cd doc; $(MAKE) $(MJ) -$(MAKEFLAGS) $@
  111.  
  112. elm:
  113.     cd lib; $(MAKE) $(MJ) -$(MAKEFLAGS) all
  114.     cd src; $(MAKE) $(MJ) -$(MAKEFLAGS) all
  115.  
  116. #    The dummy dependency here prevents make from thinking the target is the
  117. #    filter directory that sits in the current directory, rather than
  118. #    an abstract target.
  119. filter: _filter
  120.  
  121. _filter:
  122.     cd filter; $(MAKE) $(MJ) -$(MAKEFLAGS) all
  123.  
  124. #    The dummy dependency here prevents make from thinking the target is the
  125. #    utils directory that sits in the current directory, rather than
  126. #    an abstract target.
  127. utils: _utils
  128.  
  129. _utils:
  130.     cd utils; $(MAKE) $(MJ) -$(MAKEFLAGS) all
  131.  
  132. !NO!SUBS!
  133.